package cn.wolfcode.wolf2w.service;

import cn.wolfcode.wolf2w.domain.Travel;
import cn.wolfcode.wolf2w.query.TravelQuery;
import cn.wolfcode.wolf2w.redis.vo.TravelStatisVo;
import org.springframework.data.domain.Page;

import java.util.List;

public interface ITravelService {
    void save(Travel travel);
    void update(Travel travel);
    void delete(String id);
    Travel get(String id);
    List<Travel> listAll();

    Page<Travel> query(TravelQuery qo);

    void saveOrUpdate(Travel travel);

    /**
     * 审核成功或拒绝
     * @param id
     * @param state
     */
    void changeState(String id, int state);

    List<Travel> findByDestId(String id);

    /**
     * 下架
     * @param id
     * @param state
     */
    void soldOut(String id, int state);

    /**
     * 获取游记vo
     * @param tid
     * @return
     */
    TravelStatisVo getStatisVo(String tid);

    /**
     * 用户收藏游记集合 list
     * @param userId
     * @return
     */
    List<String> getUserTravelFavor(String userId);

    List<Travel> findByDestName(String destName);
}
